import request from '@/utils/request'

// -----应用中心预约模块----
// ----店铺设置start----

// 获取店铺配置详情
export function getAppointmentConfig(params) {
  return request({
    url: `/appointment/config/`,
    method: 'get',
    params
  })
}
// 更新店铺设置
export function updateAppointmentConfig(data) {
  return request({
    url: `/appointment/config/update`,
    method: 'put',
    data
  })
}

// 新增入驻店铺
export function addStore(params) {
  return request({
    url: `/appointment/config/bind`,
    method: 'get',
    params
  })
}
export function updateStoreStatus(params) {
  return request({
    url: '/appointment/config/update/business/status',
    method: 'get',
    params
  })
}

// ----店铺设置end----

// 获取店铺列表
export function storeList(params) {
  return request({
    url: `/appointment/config/shop/list`,
    method: 'get',
    params
  })
}

// -----资源设置 start-----
// 资源列表
export function getAppointmentCategoryQryLis(params) {
  return request({
    url: `/appointment/category/qryList`,
    method: 'get',
    params
  })
}
export function getAppointmentLevelLis(params) {
  return request({
    url: `/appointment/level/get/list`,
    method: 'get',
    params
  })
}
export function updateAppointmentCategory(params) {
  return request({
    url: `/appointment/category/update/status`,
    method: 'get',
    params
  })
}
export function getAppointmentCategoryDetail(params) {
  return request({
    url: `/appointment/category`,
    method: 'get',
    params
  })
}
export function addAppointmentCategoryDetail(data) {
  return request({
    url: `/appointment/category/add`,
    method: 'post',
    data
  })
}
export function updateAppointmentCategoryDetail(data) {
  return request({
    url: `/appointment/category/update`,
    method: 'put',
    data
  })
}
export function delAppointmentCategoryDetail(params) {
  return request({
    url: `/appointment/category/del`,
    method: 'DELETE',
    params
  })
}
// 等级列表
export function getAppointmentLevelQryLis(params) {
  return request({
    url: `/appointment/level/qryList`,
    method: 'get',
    params
  })
}
export function addAppointmentLevelDetail(data) {
  return request({
    url: `/appointment/level/add`,
    method: 'post',
    data
  })
}
export function updateAppointmentLevelDetail(data) {
  return request({
    url: `/appointment/level/update`,
    method: 'put',
    data
  })
}
export function delAppointmentLevelDetail(params) {
  return request({
    url: `/appointment/level/del`,
    method: 'DELETE',
    params
  })
}
export function updateAppointmentLevelStatus(params) {
  return request({
    url: `/appointment/level/update/status`,
    method: 'get',
    params
  })
}
export function getAppointmentLevelDetail(params) {
  return request({
    url: `/appointment/level`,
    method: 'get',
    params
  })
}
export function selectShopUser(data) {
  return request({
    url: `/appointment/shop/user/selectShopUser`,
    method: 'post',
    data
  })
}

// 方案管理

export function getAppointmentPlanQryLis(params) {
  return request({
    url: `/appointment/plan/qryList`,
    method: 'get',
    params
  })
}
export function addAppointmentPlanDetail(data) {
  return request({
    url: `/appointment/plan/add`,
    method: 'post',
    data
  })
}
export function updateAppointmentPlanDetail(data) {
  return request({
    url: `/appointment/plan/update`,
    method: 'put',
    data
  })
}
export function delAppointmentPlanDetail(params) {
  return request({
    url: `/appointment/plan/del`,
    method: 'DELETE',
    params
  })
}
export function updateAppointmentPlanStatus(params) {
  return request({
    url: `/appointment/plan/update/status`,
    method: 'get',
    params
  })
}
export function getAppointmentPlanDetail(params) {
  return request({
    url: `/appointment/plan`,
    method: 'get',
    params
  })
}

// -----资源设置 end-----

// ----装修设置 start -----
export function productList(params) {
  return request({
    url: `/appointment/order/get/mall/commodity`,
    method: 'get',
    params
  })
}

/**
 * @method getShelfList
 * @description 获取货架列表
 */
export function getShelfList(data) {
  return request({
    url: '/appointment/admin/plan/shelf/list',
    method: 'post',
    data: data
  })
}
export function getPlanShelfList(data) {
  return request({
    url: '/appointment/admin/plan/shelf/list',
    method: 'post',
    data: data
  })
}

export function saveShelf(data) {
  return request({
    url: `/appointment/admin/plan/shelf/save`,
    method: 'post',
    data
  })
}

// -----装修设置 end-----

// -----预约订单 start-----
export function getReservationOrderList(data) {
  return request({
    url: `/appointment/order/qryList`,
    method: 'post',
    data
  })
}

export function printReservationOrder(params) {
  return request({
    url: `/appointment/order/printOrder`,
    method: 'get',
    params
  })
}

// -----预约订单 end-----

export function orderDetail(params) {
  return request({
    url: `/appointment/order/detail`,
    method: 'get',
    params
  })
}

// 打印小票
export function putSealTicket(params) {
  return request({
    url: `/appointment/order/printOrder`,
    method: 'get',
    params
  })
}

// 订单备注
export function orderRemark(params) {
  return request({
    url: `/appointment/order/businessRemark`,
    method: 'get',
    params
  })
}

// 核销订单
export function writeOffOrder(params) {
  return request({
    url: `/appointment/order/writeOffOrder`,
    method: 'post',
    params
  })
}

// 修改预约时间
export function amend(data) {
  return request({
    url: `/appointment/order/updatePreTime`,
    method: 'post',
    data
  })
}

// 取消订单
export function orderCancel(data) {
  return request({
    url: `/appointment/order/cancel`,
    method: 'post',
    data
  })
}

// 导出预约订单
export function downMallOrdersList(data) {
  return request({
    url: '/statistics_admin/task/export_appointment_order',
    method: 'post',
    data: data
  })
}

// 导出预约资源
export function downMallResourcesList(data) {
  return request({
    url: '/statistics_admin/task/export_appointment_category',
    method: 'post',
    data: data
  })
}
